// 需要安装PHP，暂时无法使用 
$('.button').on('click',()=>{
	let username = document.getElementsByTagName('input')[0].value;
	console.log(username);
	let xhr = new XMLHttpRequest();
	xhr.open('get',`./public/demo.php?username=${username}`);
	xhr.send();
	xhr.onreadystatechange = function(){
		if(xhr.readyState === 4){
			if(xhr.status === 200){
				let resp = xhr.responseText;
				console.log('获取后台发送信息：',xhr.responseText);
				if(resp.url){
					$('.span').innerHTML = `数据显示：${resp.username}`
				}else{
					$('.span').innerHTML =`${resp.mes}`
				}
			}
		}
	}
})
